﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports DataObject.hDBase

Public Class BusVatTuHopDong

    Private VatTuHopDongDAO As New SqlServerVatTuHopDong
    Private oTable As New DataTable

    Public Function GetAllVatTuHopDong(ByVal sStringConnection As String) As Object
        Try
            oTable = VatTuHopDongDAO.GetAllVatTuHopDong(sStringConnection)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Return oTable
    End Function

    Public Sub InsertVatTuHopDong(ByVal sStringConnection As String, ByVal oVatTuHopDong As VatTuHopDong)
        Try
            VatTuHopDongDAO.InsertVatTuHopDong(sStringConnection, oVatTuHopDong)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub UpdateVatTuHopDong(ByVal sStringConnection As String, ByVal oVatTuHopDong As VatTuHopDong)
        Dim bool_ As Boolean = True
        Try
            VatTuHopDongDAO.UpdateVatTuHopDong(sStringConnection, oVatTuHopDong)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub DeleteVatTuHopDong(ByVal sStringConnection As String, ByVal oVatTuHopDong As VatTuHopDong)
        Try
            VatTuHopDongDAO.DeleteVatTuHopDong(sStringConnection, oVatTuHopDong.SoVatTuHopDong)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub


End Class
